12015f60703133006949dd6a02522e7b1876597e,src/main/java/io/github/jhipster/sample/aop/logging/LoggingAspect.java,LoggingAspect,logAfterThrowing,#JoinPoint#Throwable#,34
Before Change
public void logAfterThrowing(JoinPoint joinPoint, Throwable e) {
if (env.acceptsProfiles(Constants.SPRING_PROFILE_DEVELOPMENT)) {
log.error("Exception in {}.{}() with cause = \'{}\' and exception = \'{}\'", joinPoint.getSignature().getDeclaringTypeName(),
joinPoint.getSignature().getName(), e.getCause(), e.getMessage());
e.printStackTrace();
} else {
log.error("Exception in {}.{}() with cause = {}", joinPoint.getSignature().getDeclaringTypeName(),
joinPoint.getSignature().getName(), e.getCause());
}
}
After Change
public void logAfterThrowing(JoinPoint joinPoint, Throwable e) {
if (env.acceptsProfiles(Constants.SPRING_PROFILE_DEVELOPMENT)) {
log.error("Exception in {}.{}() with cause = \'{}\' and exception = \'{}\'", joinPoint.getSignature().getDeclaringTypeName(),
joinPoint.getSignature().getName(), (e.getCause() != null? e.getCause() : "NULL"), e.getMessage());
e.printStackTrace();
} else {
log.error("Exception in {}.{}() with cause = {}", joinPoint.getSignature().getDeclaringTypeName(),
joinPoint.getSignature().getName(), (e.getCause() != null? e.getCause() : "NULL"));
}
}